package practice3;

import java.util.Scanner;

public class P8723 {

    public static String getStr(int num){
        String res;
        if(num<10){
            res=num+"";
        }else{
            char ch=(char) (65+(num-10));
            res=ch+"";
        }
        return res;
    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int p = sc.nextInt();
        for(int i=1;i<=p-1;i++){
            for(int j=1;j<=i;j++){
                String a = getStr(i);
                String b = getStr(j);
                if(i*j<p){
                    String c = getStr(i * j);
                    System.out.print(a+"*"+b+"="+c+" ");
                }else {
                    String c1 = getStr(i * j / p);
                    String c2 = getStr(i * j % p);
                    System.out.print(a+"*"+b+"="+c1+c2+" ");
                }
            }
            System.out.println();
        }
    }
}
